package cn.signalpha.modules.shop.entity;

import cn.signalpha.modules.shop.vo.OrderGoodsVO;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 订单详情实体类
 *
 * @author suguangjun
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("shop_order_detail")
@ApiModel(value = "OrderDetail对象", description = "订单详情")
public class OrderDetail implements Serializable {

    private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "商户id")
    private Long sellerId;

    @ApiModelProperty(value = "商品id")
    private Long goodsId;

	@ApiModelProperty(value = "商品数量")
	private Integer goodsNum;

	@ApiModelProperty(value = "商品单价")
	private Double goodsPrice;

	@ApiModelProperty(value = "商品总价")
	private Double goodsPriceTotal;

	@ApiModelProperty(value = "商品详情")
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	private String goodsDetail;

	@TableField(exist = false)
	@ApiModelProperty(value = "商品详情")
	private OrderGoodsVO goods;

	@ApiModelProperty(value = "实际支付")
	private Double orderPrice;

	@ApiModelProperty(value = "直推金额 -1无佣金")
	private Double directMoney;

	@ApiModelProperty(value = "间推金额 -1无佣金")
	private Double indirectMoney;

	@ApiModelProperty(value = "余额抵扣")
	private Double deductMoney;

	@ApiModelProperty(value = "积分抵扣")
	private Double deductIntegral;

	@ApiModelProperty(value = "积分金额")
	private Double deductIntegralMoney;

	@ApiModelProperty(value = "商户优惠券抵扣")
	private Double deductCouponSeller;

	@ApiModelProperty(value = "平台优惠券抵扣")
	private Double deductCouponSystem;

	@ApiModelProperty(value = "营销活动抵扣")
	private Double deductPublicity;

	@ApiModelProperty(value = "营销活动ID")
	private Long deductPublicityId;

	@ApiModelProperty(value = "营销活动抵扣类型")
	private String deductPublicityType;

	@ApiModelProperty(value = "营销活动抵扣详情")
	private String deductPublicityDetail;

	@ApiModelProperty(value = "营销活动商品数量")
	private Integer deductPublicityGoodsNum;

	@ApiModelProperty(value = "发货数量")
	private Integer logisticsNum;

	@ApiModelProperty(value = "退款数量")
	private Integer refundNum;

	@ApiModelProperty(value = "售后状态：0无售后 1有售后（有处理中状态）")
	private Integer refundStatus;

    @ApiModelProperty(value = "评价状态：0未评价 1评价")
    private Integer commentStatus;

}
